package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.dal.mapper.ext.IdCardLocationExtMapper;
import com.mhc.suzuki.dal.model.IdCardLocationDO;
import com.mhc.suzuki.dal.query.IdCardLocationQuery;
import com.mhc.suzuki.manager.IdCardLocationManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for IdCardLocation.
 */

@Component
public class IdCardLocationManagerImpl implements IdCardLocationManager {


    @Autowired
    protected IdCardLocationExtMapper idCardLocationExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(IdCardLocationQuery query) {
        return idCardLocationExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(IdCardLocationQuery query) {
        return idCardLocationExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(IdCardLocationDO record) {
        return idCardLocationExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(IdCardLocationDO record) {
        return idCardLocationExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<IdCardLocationDO> selectByQuery(IdCardLocationQuery query) {
        return idCardLocationExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<IdCardLocationDO> selectByQueryWithPage(IdCardLocationQuery query) {
        PageResult<IdCardLocationDO> result = new PageResult<IdCardLocationDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public IdCardLocationDO selectByPrimaryKey(Long id) {
        return idCardLocationExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(IdCardLocationDO record, IdCardLocationQuery query) {
        return idCardLocationExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(IdCardLocationDO record, IdCardLocationQuery query) {

        return idCardLocationExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(IdCardLocationDO record) {
        return idCardLocationExtMapper.updateByPrimaryKeySelective(record);
    }
}